package com.devstringx.pmt.utils;

import org.springframework.security.authentication.encoding.ShaPasswordEncoder;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class ApplicationUtilities {


	public boolean checkIfEmailIsValid(String emailId){

		return false;
	}

	public boolean checkIfMobileNumberIsValid(String mobileNumber){

		return false;
	}

	public static boolean isEmailServiceEnabled(){
		return Boolean.parseBoolean(getCustomProperty("enableEmailService", "true"));
	}

	public static String getHashValue(String param) {
		BCryptPasswordEncoder bCryptPasswordEncoder=new BCryptPasswordEncoder();
		return  bCryptPasswordEncoder.encode(param);

	}

	public static String getCustomProperty(String key, String defaultValue) {

		if(null== defaultValue ||  defaultValue.trim().equals("")){
			return   	ApplicationMaps.PMT_PROPERTIES.getProperty(key);
		}else  {
			return 	 ApplicationMaps.PMT_PROPERTIES.getProperty(key, defaultValue);
		}
	}
	
	public static String getExceptionLoggerName(){
		return "ExceptionLogger";
	}

}
